package com.baizhi.app;

import com.baizhi.po.VideoPO;
import com.baizhi.service.VideoService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

//@CrossOrigin(origins = "http://localhost:8989")
@RestController
@RequestMapping("app")
public class AppController {


    @Resource
    VideoService videoService;

    @RequestMapping("queryByReleaseTime")
    public HashMap<String, Object> queryByReleaseTime(){

        List<VideoPO> videoPOList = videoService.queryByReleaseTime();

        HashMap<String, Object> map = new HashMap<>();
        map.put("message","查询成功");
        map.put("status",100);
        map.put("data",videoPOList);

        return map;

    }
}
